home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1994 October / Macformat17.cdr / Shareware City / Developers / Think C dcmd 1.0 ƒ / Think Put Lib source / __BinToText.c next >
Text File  |  1994-06-15  |  185b  |  13 lines

  1. void __BinToText (unsigned long bin, char* str )
  2. {
  3.         int         n, len;
  4.         char*     digits = "01";
  5.     
  6.     len = 32-1;
  7.     
  8.     for ( n = len; n >= 0; n-- )
  9.     {
  10.         str[n] = digits[bin % 2];
  11.         bin /= 2;
  12.     }
  13. }